
<template>
  <view class="page-container">
    <scroll-view scroll-y="true" class="page-body py-32">
      <view class="box-shadows py-36 px-32 flex items-center justify-between mt-24" v-for="n in listData" :key="n.id" @click="toDetail(n)">
        <view class="font-bold">{{n.testPaperName}}</view>
        <view class="flex items-center"><image class="w-20 h-28 ml-12" src="/static/images/right.png" /></view>
      </view>
    </scroll-view>
  </view>
</template>
<script setup>
import { ref} from 'vue'
import {onLoad,onShow} from "@dcloudio/uni-app"
import utils from '@/utils/utils.js'
import  {subject} from '@/api'
import useUserStore from '@/store/user.js'
const useStore = useUserStore()
const type = ref(0)
onLoad(async (options) => {
  if(options.type){
    type.value = Number(options.type)
  }
})
const listData = [{
  "fillScore": 5,
  "mnksExamMaxTime": 60,
  "id": 343,
  "judgeScore": 5,
  "mnksExamPassScore": 60,
  "validityEnd": "2025-02-28 00:00:00",
  "testPaperName": "理论考试",
  "updateTime": null,
  "validityStart": "2025-02-21 00:00:00",
  "mnksExamMaxCount": 100,
  "multipleScore": 5,
}, {
  "fillScore": 5,
  "mnksExamMaxTime": 10,
  "id": 344,
  "judgeScore": 5,
  "mnksExamPassScore": 60,
  "validityEnd": "2025-02-28 00:00:00",
  "testPaperName": "综合问答",
  "updateTime": null,
  "validityStart": "2025-02-21 00:00:00",
  "mnksExamMaxCount": 10,
  "multipleScore": 5,
}, {
  "fillScore": 5,
  "mnksExamMaxTime": 30,
  "id": 345,
  "judgeScore": 5,
  "mnksExamPassScore": 60,
  "validityEnd": "2025-02-28 00:00:00",
  "testPaperName": "综合问答精选",
  "updateTime": null,
  "validityStart": "2025-02-21 00:00:00",
  "mnksExamMaxCount": 33,
  "multipleScore": 5,
}]
const toDetail = (item) => {
  if(type.value === 1){
    uni.navigateTo({
      url: `/pages/my/ranking/index?id=${item.id}&name=${item.testPaperName}`
    })
  }else{
    uni.navigateTo({
      url: `/pages/my/examRecords/list?id=${item.id}&name=${item.testPaperName}`
    })
  }
}
</script>
<style scoped lang="scss">
</style>